import com.example.demo.chap2.Demo;
import jakarta.ws.rs.core.Application;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;



public class test {

        String cname;
        int cid;
        test(){}
        //getters and setters
        @Test
        //基于xml的注入案例
        public void display(){
                ApplicationContext applicationContext = new ClassPathXmlApplicationContext("demo.xml");
                Demo demo1 = applicationContext.getBean("demo1",Demo.class);
                demo1.display();
                Demo demo2 = applicationContext.getBean("demo2",Demo.class);
                demo2.display();


        }



}
